vim.cmd.highlight 'clear'
if vim.g.syntax_on then
  vim.cmd.syntax 'reset'
end
vim.g.colors_name = 'tempus_totus'

local black = '#4a484d'
local red = '#a50000'
local green = '#005d26'
local yellow = '#714700'
local blue = '#1d3ccf'
local magenta = '#88267a'
local cyan = '#185570'
local white = '#efefef'
local bright_black = '#5e4b4f'
local bright_red = '#992030'
local bright_green = '#4a5500'
local bright_yellow = '#8a3600'
local bright_blue = '#2d45b0'
local bright_magenta = '#700dc9'
local bright_cyan = '#005289'
local bright_white = '#ffffff'
vim.g.terminal_color_0 = black
vim.g.terminal_color_1 = red
vim.g.terminal_color_2 = green
vim.g.terminal_color_3 = yellow
vim.g.terminal_color_4 = blue
vim.g.terminal_color_5 = magenta
vim.g.terminal_color_6 = cyan
vim.g.terminal_color_7 = white
vim.g.terminal_color_8 = bright_black
vim.g.terminal_color_9 = bright_red
vim.g.terminal_color_10 = bright_green
vim.g.terminal_color_11 = bright_yellow
vim.g.terminal_color_12 = bright_blue
vim.g.terminal_color_13 = bright_magenta
vim.g.terminal_color_14 = bright_cyan
vim.g.terminal_color_15 = bright_white
local theme = {
  WarningMsg = { bg = '#714900', fg = bright_white },
  Function = { fg = '#882a7a' },
  Keyword = { fg = '#7310cb', bold = true },
  NormalFloat = { link = 'Normal' },
  Constant = { fg = '#1d3fcf' },
  Operator = { fg = black, bold = true },
  String = { fg = '#2d48b0' },
  Number = { fg = '#1d3fcf' },
  Boolean = { fg = '#185870' },
  Statement = { fg = '#4a5700' },
  Italic = {  },
  debugPC = {  },
  Exception = { fg = '#f45858', bold = true },
  Include = { fg = '#9b2230' },
  PreProc = { fg = '#9b2230' },
  Define = { fg = '#9b2230' },
  Macro = { fg = '#9b2230', bold = true },
  PreCondit = { fg = '#9b2230', bold = true },
  StorageClass = { fg = '#185870' },
  Structure = { fg = '#185870' },
  Typedef = { fg = '#005589', bold = true },
  Tag = { fg = '#882a7a' },
  Special = { fg = '#8b3800', bold = true },
  SpecialChar = { fg = '#8b3800', bold = true },
  Delimiter = { fg = '#882a7a', bold = true },
  SpecialComment = { fg = '#882a7a', bold = true },
  Debug = { fg = '#7310cb' },
  MatchParen = { bg = '#f3f1f3', fg = '#5f4d4f', underline = true, bold = true },
  Ignore = { bg = '#f3f1f3', fg = '#5f4d4f' },
  Type = { fg = '#185870', bold = true },
  Delimeter = { fg = '#882a7a', bold = true },
  Todo = { fg = '#8b3800', bg = '#f3f1f3', bold = true },
  Character = { fg = '#005589', bold = true },
  Float = { fg = '#1d3fcf' },
  Identifier = { fg = '#7310cb' },
  Conditional = { fg = '#005f26', bold = true },
  Repeat = { fg = '#4a5700', bold = true },
  Label = { fg = '#882a7a' },
  Error = { bg = '#f45858', fg = bright_white },
  Warning = { bg = '#714900', fg = bright_white },
  Comment = { italic = true, fg = '#5f4d4f' },
  Underlined = { underline = true, fg = black },
  MarkdownOrderedListMarker = { link = 'MarkdownListMarker' },
  MarkdownListMarker = { fg = '#005f26' },
  MarkdownCodeBlock = { fg = black },
  MarkdownCodeDelimiter = { link = 'MarkdownCode' },
  MarkdownCode = { fg = '#882a7a' },
  MarkdownLinkTextDelimiter = { link = 'MarkdownLinkDelimiter' },
  MarkdownLinkDelimiter = { fg = black, bold = true },
  MarkdownLinkText = { fg = '#2d48b0' },
  MarkdownUrl = { underline = true, fg = '#1d3fcf' },
  MarkdownItalicDelimiter = { link = 'MarkdownItalic' },
  NvimInvalidFloat = { link = 'NvimInvalidNumber' },
  NvimInvalidNumberPrefix = { link = 'NvimInvalidNumber' },
  NvimInvalidOptionSigil = { link = 'NvimInvalidIdentifier' },
  NvimInvalidOptionName = { link = 'NvimInvalidIdentifier' },
  NvimInvalidOptionScope = { link = 'NvimInvalidIdentifierScope' },
  NvimInvalidOptionScopeDelimiter = { link = 'NvimInvalidIdentifierScopeDelimiter' },
  NvimInvalidEnvironmentSigil = { link = 'NvimInvalidOptionSigil' },
  NvimInvalidEnvironmentName = { link = 'NvimInvalidIdentifier' },
  NvimInvalidStringBody = { link = 'NvimStringBody' },
  NvimInvalidStringQuote = { link = 'NvimInvalidString' },
  NvimInvalidStringSpecial = { link = 'NvimStringSpecial' },
  NvimInvalidSingleQuote = { link = 'NvimInvalidStringQuote' },
  NvimInvalidSingleQuotedBody = { link = 'NvimInvalidStringBody' },
  NvimInvalidSingleQuotedQuote = { link = 'NvimInvalidStringSpecial' },
  NvimInvalidDoubleQuote = { link = 'NvimInvalidStringQuote' },
  NvimInvalidDoubleQuotedBody = { link = 'NvimInvalidStringBody' },
  NvimInvalidDoubleQuotedEscape = { link = 'NvimInvalidStringSpecial' },
  NvimInvalidDoubleQuotedUnknownEscape = { link = 'NvimInvalidValue' },
  NvimInvalidFigureBrace = { link = 'NvimInvalidDelimiter' },
  NvimInvalidSpacing = { link = 'ErrorMsg' },
  NvimDoubleQuotedUnknownEscape = { link = 'NvimInvalidValue' },
  DiagnosticError = { fg = '#ff0000' },
  DiagnosticWarn = { fg = '#ffa500' },
  DiagnosticInfo = { fg = '#add8e6' },
  DiagnosticHint = { fg = '#d3d3d3' },
  DiagnosticVirtualTextInfo = { link = 'DiagnosticInfo' },
  DiagnosticUnderlineHint = { underline = true, special = '#d3d3d3' },
  DiagnosticUnderlineError = { underline = true, special = '#ff0000' },
  DiagnosticUnderlineWarn = { underline = true, special = '#ffa500' },
  DiagnosticUnderlineInfo = { underline = true, special = '#add8e6' },
  DiagnosticFloatingHint = { link = 'DiagnosticHint' },
  DiagnosticFloatingError = { link = 'DiagnosticError' },
  DiagnosticFloatingWarn = { link = 'DiagnosticWarn' },
  DiagnosticFloatingInfo = { link = 'DiagnosticInfo' },
  DiagnosticSignHint = { link = 'DiagnosticHint' },
  DiagnosticSignError = { link = 'DiagnosticError' },
  DiagnosticSignWarn = { link = 'DiagnosticWarn' },
  DiagnosticSignInfo = { link = 'DiagnosticInfo' },
  NvimInternalError = { bg = '#ff0000', fg = '#ff0000' },
  NvimAssignment = { link = 'Operator' },
  NvimPlainAssignment = { link = 'NvimAssignment' },
  NvimAugmentedAssignment = { link = 'NvimAssignment' },
  NvimAssignmentWithAddition = { link = 'NvimAugmentedAssignment' },
  NvimAssignmentWithSubtraction = { link = 'NvimAugmentedAssignment' },
  NvimAssignmentWithConcatenation = { link = 'NvimAugmentedAssignment' },
  NvimOperator = { link = 'Operator' },
  NvimUnaryOperator = { link = 'NvimOperator' },
  NvimUnaryPlus = { link = 'NvimUnaryOperator' },
  NvimUnaryMinus = { link = 'NvimUnaryOperator' },
  NvimNot = { link = 'NvimUnaryOperator' },
  NvimBinaryOperator = { link = 'NvimOperator' },
  NvimComparison = { link = 'NvimBinaryOperator' },
  NvimComparisonModifier = { link = 'NvimComparison' },
  NvimBinaryPlus = { link = 'NvimBinaryOperator' },
  NvimBinaryMinus = { link = 'NvimBinaryOperator' },
  Normal = { bg = bright_white, fg = black },
  NvimConcatOrSubscript = { link = 'NvimConcat' },
  NvimOr = { link = 'NvimBinaryOperator' },
  NvimAnd = { link = 'NvimBinaryOperator' },
  NvimMultiplication = { link = 'NvimBinaryOperator' },
  NvimDivision = { link = 'NvimBinaryOperator' },
  NvimMod = { link = 'NvimBinaryOperator' },
  NvimTernary = { link = 'NvimOperator' },
  NvimParenthesis = { link = 'Delimiter' },
  NvimLambda = { link = 'NvimParenthesis' },
  NvimNestingParenthesis = { link = 'NvimParenthesis' },
  NvimCallingParenthesis = { link = 'NvimParenthesis' },
  NvimSubscript = { link = 'NvimParenthesis' },
  NvimSubscriptBracket = { link = 'NvimSubscript' },
  NvimSubscriptColon = { link = 'NvimSubscript' },
  NvimCurly = { link = 'NvimSubscript' },
  NvimContainer = { link = 'NvimParenthesis' },
  NvimDict = { link = 'NvimContainer' },
  NvimList = { link = 'NvimContainer' },
  NvimIdentifier = { link = 'Identifier' },
  NvimIdentifierScope = { link = 'NvimIdentifier' },
  NvimIdentifierScopeDelimiter = { link = 'NvimIdentifier' },
  NvimIdentifierName = { link = 'NvimIdentifier' },
  NvimIdentifierKey = { link = 'NvimIdentifier' },
  NvimColon = { link = 'Delimiter' },
  NvimComma = { link = 'Delimiter' },
  NvimArrow = { link = 'Delimiter' },
  NvimRegister = { link = 'SpecialChar' },
  Question = { fg = '#8b3800', bold = true },
  NvimFloat = { link = 'NvimNumber' },
  NvimNumberPrefix = { link = 'Type' },
  NvimOptionSigil = { link = 'Type' },
  NvimOptionName = { link = 'NvimIdentifier' },
  NvimOptionScope = { link = 'NvimIdentifierScope' },
  NvimOptionScopeDelimiter = { link = 'NvimIdentifierScopeDelimiter' },
  NvimEnvironmentSigil = { link = 'NvimOptionSigil' },
  NvimEnvironmentName = { link = 'NvimIdentifier' },
  NvimString = { link = 'String' },
  NvimStringBody = { link = 'NvimString' },
  NvimStringQuote = { link = 'NvimString' },
  NvimStringSpecial = { link = 'SpecialChar' },
  NvimSingleQuote = { link = 'NvimStringQuote' },
  NvimSingleQuotedBody = { link = 'NvimStringBody' },
  NvimSingleQuotedQuote = { link = 'NvimStringSpecial' },
  NvimDoubleQuote = { link = 'NvimStringQuote' },
  NvimDoubleQuotedBody = { link = 'NvimStringBody' },
  NvimDoubleQuotedEscape = { link = 'NvimStringSpecial' },
  NvimFigureBrace = { link = 'NvimInternalError' },
  NvimSingleQuotedUnknownEscape = { link = 'NvimInternalError' },
  NvimSpacing = { link = 'Normal' },
  NvimInvalidSingleQuotedUnknownEscape = { link = 'NvimInternalError' },
  NvimInvalid = { link = 'Error' },
  NvimInvalidAssignment = { link = 'NvimInvalid' },
  NvimInvalidPlainAssignment = { link = 'NvimInvalidAssignment' },
  NvimInvalidAugmentedAssignment = { link = 'NvimInvalidAssignment' },
  NvimInvalidAssignmentWithAddition = { link = 'NvimInvalidAugmentedAssignment' },
  NvimInvalidAssignmentWithSubtraction = { link = 'NvimInvalidAugmentedAssignment' },
  NvimInvalidAssignmentWithConcatenation = { link = 'NvimInvalidAugmentedAssignment' },
  NvimInvalidOperator = { link = 'NvimInvalid' },
  NvimInvalidUnaryOperator = { link = 'NvimInvalidOperator' },
  NvimInvalidUnaryPlus = { link = 'NvimInvalidUnaryOperator' },
  NvimInvalidUnaryMinus = { link = 'NvimInvalidUnaryOperator' },
  NvimInvalidNot = { link = 'NvimInvalidUnaryOperator' },
  NvimInvalidBinaryOperator = { link = 'NvimInvalidOperator' },
  NvimInvalidComparison = { link = 'NvimInvalidBinaryOperator' },
  NvimInvalidComparisonModifier = { link = 'NvimInvalidComparison' },
  NvimInvalidBinaryPlus = { link = 'NvimInvalidBinaryOperator' },
  NvimInvalidBinaryMinus = { link = 'NvimInvalidBinaryOperator' },
  NvimInvalidConcat = { link = 'NvimInvalidBinaryOperator' },
  NvimInvalidConcatOrSubscript = { link = 'NvimInvalidConcat' },
  NvimInvalidOr = { link = 'NvimInvalidBinaryOperator' },
  MarkdownItalic = { italic = true, fg = '#714900' },
  MarkdownBoldDelimiter = { link = 'MarkdownBold' },
  MarkdownBold = { fg = '#9b2230', bold = true },
  MarkdownHeadingRule = { link = 'MarkdownHeading' },
  MarkdownHeadingDelimiter = { link = 'MarkdownHeading' },
  MarkdownH6 = { link = 'MarkdownHeading' },
  MarkdownH5 = { link = 'MarkdownHeading' },
  MarkdownH4 = { link = 'MarkdownHeading' },
  MarkdownH3 = { link = 'MarkdownHeading' },
  MarkdownH2 = { link = 'MarkdownHeading' },
  MarkdownH1 = { link = 'MarkdownHeading' },
  LspCodeLens = { link = 'Include' },
  MarkdownHeading = { fg = black, bold = true },
  MarkdownRule = { fg = '#4a5700', bg = '#f3f1f3', bold = true },
  LspReferenceText = { link = 'IncSearch' },
  LspReferenceRead = { link = 'IncSearch' },
  LspReferenceWrite = { link = 'IncSearch' },
  diffFile = { fg = '#714900' },
  diffNewFile = { fg = '#1d3fcf' },
  diffRemoved = { fg = '#f45858' },
  diffAdded = { fg = '#005f26' },
  VimGroup = { fg = '#882a7a' },
  VimOption = { fg = '#882a7a' },
  Terminal = { bg = bright_white, fg = black },
  ToolbarButton = { fg = bright_white, bg = '#5f4d4f', bold = true },
  ToolbarLine = { bg = '#5f4d4f', fg = bright_white },
  StatusLineTermNC = { bg = '#f3f1f3', fg = '#005f26' },
  StatusLineTerm = { bg = '#005f26', fg = bright_white },
  GPGHighlightUnknownRecipient = { link = 'ErrorMsg' },
  GPGError = { link = 'ErrorMsg' },
  GPGWarning = { link = 'WarningMsg' },
  NvimInvalidIdentifierScopeDelimiter = { link = 'NvimInvalidIdentifier' },
  HopCursor = { link = 'Cursor' },
  HopUnmatched = { fg = '#666666', special = '#666666', bg = bright_white },
  NvimInvalidIdentifierName = { link = 'NvimInvalidIdentifier' },
  HopNextKey1 = { fg = '#00dfff', bold = true },
  NvimInvalidColon = { link = 'NvimInvalidDelimiter' },
  LspSignatureActiveParameter = { link = 'WarningMsg' },
  Bold = {  },
  NvimInvalidString = { link = 'NvimInvalidValue' },
  NvimInvalidNumber = { link = 'NvimInvalidValue' },
  NvimInvalidRegister = { link = 'NvimInvalidValue' },
  NvimInvalidArrow = { link = 'NvimInvalidDelimiter' },
  NvimInvalidComma = { link = 'NvimInvalidDelimiter' },
  HopNextKey = { fg = '#ff007c', bold = true },
  NvimInvalidIdentifierKey = { link = 'NvimInvalidIdentifier' },
  IncSearch = { bg = '#5f4d4f', fg = bright_white, underline = true, bold = true },
  HopNextKey2 = { fg = '#2b8db3' },
  HopPreview = { fg = '#b8bb26', bold = true },
  NvimInvalidIdentifierScope = { link = 'NvimInvalidIdentifier' },
  NvimInvalidIdentifier = { link = 'NvimInvalidValue' },
  NvimInvalidValue = { link = 'NvimInvalid' },
  NvimInvalidList = { link = 'NvimInvalidContainer' },
  NvimInvalidDict = { link = 'NvimInvalidContainer' },
  SpecialKey = { bg = '#f3f1f3', fg = '#5f4d4f' },
  EndOfBuffer = { fg = '#5f4d4f', bold = true },
  NvimInvalidContainer = { link = 'NvimInvalidParenthesis' },
  TermCursor = { reverse = true },
  TermCursorNC = {  },
  NonText = { bg = '#f3f1f3', fg = '#5f4d4f' },
  Directory = { fg = '#005f26' },
  ErrorMsg = { bg = '#f45858', fg = bright_white },
  Search = { bg = '#f3f1f3', fg = black, underline = true, bold = true },
  CurSearch = {  },
  MoreMsg = { fg = '#4a5700', bold = true },
  ModeMsg = { fg = '#005f26', bold = true },
  LineNr = { bg = '#f3f1f3', fg = '#5f4d4f' },
  LineNrAbove = { link = 'LineNr' },
  LineNrBelow = { link = 'LineNr' },
  CursorLineNr = { fg = bright_white, bg = '#5f4d4f', bold = true },
  CursorLineSign = { link = 'SignColumn' },
  SignColumn = { bg = '#f3f1f3', fg = '#5f4d4f' },
  CursorLineFold = { link = 'FoldColumn' },
  FoldColumn = { bg = '#f3f1f3', fg = '#5f4d4f' },
  StatusLine = { bg = black, fg = bright_white },
  StatusLineNC = { bg = '#f3f1f3', fg = '#5f4d4f' },
  WinSeparator = { link = 'VertSplit' },
  VertSplit = {  },
  Title = { fg = '#185870', bg = bright_white, bold = true },
  Visual = { bg = black, fg = bright_white },
  VisualNC = {  },
  WildMenu = { bg = bright_white, fg = black },
  Folded = { bg = '#f3f1f3', fg = '#5f4d4f' },
  DiffAdd = { fg = bright_white, bg = '#005f26', bold = true },
  DiffChange = { fg = '#5f4d4f', bg = '#f3f1f3', bold = true },
  DiffDelete = { bg = '#f45858', fg = bright_white },
  DiffText = { fg = '#9b2230', bg = '#f3f1f3', bold = true },
  Conceal = { bg = '#5f4d4f', fg = '#f3f1f3' },
  SpellBad = { undercurl = true, fg = bright_white, special = '#ff0000', bg = '#f45858' },
  NvimInvalidCurly = { link = 'NvimInvalidSubscript' },
  NvimInvalidSubscriptColon = { link = 'NvimInvalidSubscript' },
  SpellCap = { undercurl = true, fg = bright_white, special = '#0000ff', bg = '#714900' },
  SpellRare = { undercurl = true, fg = bright_white, special = '#ff00ff', bg = '#7310cb' },
  SpellLocal = { undercurl = true, fg = bright_white, special = '#008b8b', bg = '#005589' },
  Pmenu = { fg = black, italic = true, bg = '#f3f1f3' },
  NvimInvalidSubscriptBracket = { link = 'NvimInvalidSubscript' },
  PmenuSel = { fg = bright_white, bg = '#5f4d4f', bold = true },
  PmenuSbar = { bg = '#f3f1f3' },
  PmenuThumb = { bg = '#5f4d4f' },
  TabLine = { bg = '#f3f1f3', fg = '#5f4d4f' },
  TabLineSel = { bg = '#185870', fg = bright_white },
  TabLineFill = {  },
  CursorColumn = { bg = '#f3f1f3' },
  CursorLine = { bg = '#f3f1f3' },
  ColorColumn = { bg = '#f3f1f3', fg = black },
  QuickFixLine = { link = 'Search' },
  Whitespace = { link = 'NonText' },
  NormalNC = {  },
  MsgSeparator = { link = 'StatusLine' },
  MsgArea = {  },
  FloatBorder = { link = 'WinSeparator' },
  WinBar = { bold = true },
  WinBarNC = { link = 'WinBar' },
  Cursor = { bg = black, fg = bright_white },
  lCursor = { bg = black, fg = bright_white },
  Substitute = { link = 'Search' },
  FloatShadow = { blend = 80, bg = '#000000' },
  NvimInvalidSubscript = { link = 'NvimInvalidParenthesis' },
  NvimInvalidCallingParenthesis = { link = 'NvimInvalidParenthesis' },
  NvimInvalidNestingParenthesis = { link = 'NvimInvalidParenthesis' },
  NvimInvalidLambda = { link = 'NvimInvalidParenthesis' },
  NvimInvalidParenthesis = { link = 'NvimInvalidDelimiter' },
  NvimInvalidDelimiter = { link = 'NvimInvalid' },
  NvimInvalidTernaryColon = { link = 'NvimInvalidTernary' },
  NvimInvalidTernary = { link = 'NvimInvalidOperator' },
  NvimInvalidMod = { link = 'NvimInvalidBinaryOperator' },
  NvimInvalidDivision = { link = 'NvimInvalidBinaryOperator' },
  NvimInvalidMultiplication = { link = 'NvimInvalidBinaryOperator' },
  FloatShadowThrough = { blend = 100, bg = '#000000' },
  RedrawDebugNormal = { reverse = true },
  RedrawDebugClear = { bg = '#ffff00' },
  RedrawDebugComposed = { bg = '#008000' },
  RedrawDebugRecompose = { bg = '#ff0000' },
  NvimInvalidAnd = { link = 'NvimInvalidBinaryOperator' },
  NvimNumber = { link = 'Number' },
  NvimTernaryColon = { link = 'NvimTernary' },
  NvimConcat = { link = 'NvimBinaryOperator' },
  DiagnosticVirtualTextHint = { link = 'DiagnosticHint' },
  DiagnosticVirtualTextWarn = { link = 'DiagnosticWarn' },
  DiagnosticVirtualTextError = { link = 'DiagnosticError' },
}
for k, v in pairs(theme) do
  vim.api.nvim_set_hl(0, k, v)
end
